<!DOCTYPE html>
<html>
<head>
    <title>div测试</title>
    <script type="text/javascript" src="../../js/jquery-3.2.1.min.js"></script>
</head>
<body>
<input name='a1' type="checkbox" value="1"/>a1<br>
<input name='a2' type="checkbox" value="1"/>a2
<button id="btn">aaaaa</button>
    <script type="text/javascript">
        /*function testMethod(a) {
            console.log(a);
            console.log(arguments[3]);
        }

        function regex() {
            var s = "1000000.12";
            console.log(/^\d{1,6}\.\d{0,2}$/.test(s));
        }
        regex();
        testMethod(1,2,3,4,5);*/
        var value1 = "12312345678";
        var value2 = "13178956541";
        if (/^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/.test(value2)) {
            console.log("手機驗證");
        }
        if (/^[0-9]{3,4}-?[0-9]{7,8}$/.test(value2)) {
            console.log("座機驗證");
        }
        
        $(function(){
            $("#btn").click(function(){
                var bb = $("input[name='a1']:checked");
                console.log (bb);
            });
        });
    </script>
</body>
</html>